#

| Chapter 2 Using Window Systems |

## 2.5 Working with Windows

A window manager program helps you control windows. This section explains how mwm manages windows. Other window managers do the same kinds of things - but with some variation. Let's start by looking at Figure 2.4, a typical window under mwm.

The top part of every window has a titlebar with the title of the window and three buttons. The edges of the window can be used to resize the window. (See the Note in "Resizing Windows," later in this chapter.)

### 2.5.1 Using the Titlebar

The top part of a window has three buttons (see Figure 2.4).

The two buttons at the top right corner have boxes inside them. Clicking the button with the small box makes the window as small as possible; the window turns into an icon. "Iconifying" puts unneeded windows out of the way without quitting the program inside them; it also keeps you from accidentally typing into a window. (Figure 2.1 shows an icon.) The button with the big square maximizes a window. That makes it as big as the client will allow, often as big as the screen.

#### Figure 2.4: A window running with the Motif Window Manager

The left button opens the window menu; this is explained in "The Window Menu" section later in this chapter.

### 2.5.2 Moving Windows and Icons

To move a window, start by pointing to the titlebar. To move an icon, point to it. Hold down the first mouse button and drag to the new location - then let go of the button. You can also start the move from the window menu (see the following section on the window menu), but we think this way is easier.

### 2.5.3 Resizing Windows

If you have the pointer inside a window and then move the pointer to an edge, the pointer will change to an arrow shape. The arrow points the direction that you can resize the window. If you pointed to one of the corners, you can resize both sides that meet at the corner. To resize when you have the arrow pointer, press and hold the first button, then drag the window border until the window size is what you want and release the button. If you don't get quite the size you want, just do it again.

> NOTE: On some versions of UNIX and with some programs, changing the size of an xterm window may confuse programs currently running in that window. Also, remember that many UNIX terminals are 80 characters wide; if you're editing text in a window and change its width to something other than 80 characters, that can cause trouble later when the file is viewed on a standard 80-character-wide terminal.

### 2.5.4 The Window Menu

Under mwm, each window can be controlled by its own window menu. There are lots of ways to get a window menu. Here are two: click on the menu button at the top left corner of a frame (Figure 2.4), or click on an icon. Figure 2.5 shows a window menu. When the menu pops up, you can point to one of the items and click it:

#### Figure 2.5: The mwm window menu

- Restore restores a minimized (icon) or maximized window to its original size. In Figure 2.5, the Restore entry is in a lighter typeface; this means you can't select it. (The window is already its normal size; restoring it wouldn't do anything.)

- Move lets you reposition a window on the screen.

- Size lets you change a window's size. (See the preceding Note.)

- The Minimize and Maximize operations are explained in "Using the Titlebar," earlier in this chapter.

- Lower moves a window to the bottom of the stack, if it's in a stack of windows.

- Close terminates the window and the program in it. Use this as a last resort. If the program has a separate menu or quit command (for example, entering exit at a shell prompt in an xterm window), use it instead of Close. (See "Quitting," later in this chapter, for explanation.)

On the menu, a keyboard shortcut follows each command. You don't have to use the mouse to choose commands. For example, to Minimize (iconify) a window, hold down the `[ALT]` (or `[META]` key and press the `[F9]` key. The shortcut for bringing up the window menu (and taking it away) is to hold the `[SHIFT]` key and press the `[ESC]` (ESCAPE) key. If your keyboard doesn't have all of those keys, the menu can be customized to use different keys. O'Reilly & Associates' X Window System User's Guide, Volume 3M, explains how.

#### 2.5.4.1 Exercise

Copy and paste part of a command line. | Type `who am i;date` and press `[RETURN]` in one xterm window. Highlight the `who am i`, set focus to the other xterm window, and copy the command there.
Move a window. | Grab and drag the window by its titlebar.
Iconify a window from the titlebar. | Use the Mimimize button.
Restore the icon. | Select Restore from the window menu.

2.4 Working with a Mouse |  | 2.6 Other X Clients